﻿using System.Collections.Generic;
using Metro.Kashikoi.Service.Common.Entity;
using Metro.Kashikoi.ServiceContract.Item;

namespace Metro.Kashikoi.Service.Item.Business
{
    /// <summary>
    /// This interface provides methods to manage the items.
    /// </summary>
    interface IItemFacade
    {
        /// <summary>
        /// Deletes the items of vendor.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="vendorId">The vendor id.</param>
        /// <param name="deletedItems">The deleted items.</param>
        void DeleteItemsOfVendor(IUnitOfWork context, int vendorId, IList<int> deletedItems);

        /// <summary>
        /// Deletes the items of category.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="categoryId">The category id.</param>
        /// <param name="deletedItems">The deleted items.</param>
        void DeleteItemsOfCategory(IUnitOfWork context, int categoryId, IList<int> deletedItems);

        /// <summary>
        /// Creates the item.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="item">The item.</param>
        /// <param name="category">The category.</param>
        /// <param name="vendor">The vendor.</param>
        void CreateItem(IUnitOfWork context, StockItem item, Category category, Vendor vendor);

        /// <summary>
        /// Updates the item.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="item">The item.</param>
        /// <param name="category">The category.</param>
        /// <param name="vendor">The vendor.</param>
        void UpdateItem(IUnitOfWork context, StockItem item, Category category, Vendor vendor);

        /// <summary>
        /// Deletes the item.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="itemId">The item id.</param>
        void DeleteItem(IUnitOfWork context, int itemId);

        /// <summary>
        /// Gets all items.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>A list of all itmes.</returns>
        IList<StockItem> GetAllItems(IUnitOfWork context);

        /// <summary>
        /// Imports the items.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="path">The path.</param>
        void ImportItems(IUnitOfWork context, string path);

        /// <summary>
        /// Creates the charge department.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="chargeDepartment">The charge department.</param>
        void CreateChargeDepartment(IUnitOfWork context, ChargeDepartment chargeDepartment);

        /// <summary>
        /// Updates the charge department.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="chargeDepartment">The charge department.</param>
        void UpdateChargeDepartment(IUnitOfWork context, ChargeDepartment chargeDepartment);

        /// <summary>
        /// Deletes the charge department.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="chargeDepartmentId">The charge department id.</param>
        /// <param name="deletedItems">The deleted items.</param>
        void DeleteChargeDepartment(IUnitOfWork context, int chargeDepartmentId, IList<int> deletedItems);

        /// <summary>
        /// Gets all charge departments.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>A list of all charge departments.</returns>
        IList<ChargeDepartment> GetAllChargeDepartments(IUnitOfWork context);

        /// <summary>
        /// Gets the item.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="id">The id.</param>
        /// <param name="includeCategory">if set to <c>true</c> [include category]
        /// the category will be fetched.</param>
        /// <param name="includeVendor">if set to <c>true</c> [include vendor] 
        /// the vendor will be fetched.</param>
        /// <param name="includeChargeDepartment">if set to <c>true</c> [include charge department]
        /// the charge department will be fetched..</param>
        /// <returns>
        /// The item.
        /// </returns>
        StockItem GetItem(IUnitOfWork context, int id, 
            bool includeCategory, bool includeVendor, bool includeChargeDepartment);
    }
}
